<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button id="btn1" onclick="foo1()">按钮1</button>
		<button id="btn2">按钮2</button>
		<button id="btn3">按钮3</button>
		<div id="div01" onclick="alert('div01被点击了')">div01</div>
		<script type="text/javascript">
			function foo1(){
				alert("按钮1被点击了");
			}
			function foo2(){
				alert("按钮2被点击了");
			}
			function foo2b(){
				alert("按钮2被点击了b");
			}
			function foo3(){
				alert("按钮3被点击了");
			}
			function foo3b(){
				alert("按钮3被点击了b");
			}
			btn2.onclick=foo2;
			btn2.onclick=foo2b;
			//注册事件监听
			btn3.addEventListener("click",foo3);
			btn3.addEventListener("click",foo3b);
			//移除监听
			btn3.removeEventListener("click",foo3);
		</script>
	</body>
</html>
